There are many marshalling/serializing frameworks that purport to know what data needs to be serialized in order to save the state of a given, pre-existing object; and how to reconstruct the same object given the serialized representation. JAVA™ Serialization, XMI®, SOAP, ValueClasses, and JVT's provide some examples of such marshalling/serializing frameworks. (JAVA™ is a trademark of Sun Microsystems™, Inc., Santa Clara, Calif., U.S.A.; XMI® is a registered trademark of Object Management Group™, Inc., Needham, Mass., U.S.A.).
In addition, there is the Universal Test Client in WSAD (WEBSPHERE® Studio Application Developer), which addresses marshalling/serializing issues in a data and behavioral manner. (WEBSPHERE® is a registered trademark of IBM® Corporation, Armonik, N.Y., U.S.A. It allows the user to construct objects of arbitrary data types by first allowing the user to choose one of the available constructors for the object, and to specify the data for that constructor; and then subsequently allowing the user to execute methods of that object, and again pass data into those methods, in order to complete the process of driving it into the desired state.